package polymorphism;

/**
 * @author yuisama
 * @date 2022/09/14 21:35
 * 方法重写的规则
 **/
public class OverrideTest {

}
class Base {
    public static void main(String[] args) {
        Base base = new SubClass();
        base.test();
    }
    public static int test() {
        System.out.println("Base类的test方法");
        return 10;
    }
}
class SubClass extends Base {
    public static int test() {
         System.out.println("SubClass的test方法");
         return 'a';
    }
}